package com.framwork.core.api.addressbook.dept.input;

import com.framwork.core.base.AbstractAPIInput;
import com.framwork.core.base.em.RequestMappering;
import org.apache.commons.lang3.StringUtils;

import java.text.MessageFormat;

/**
 * @author ：james.liu
 * @date ：Created in 2022/3/8 16:04
 * @description：获取单个部门信息
 * @version: 1.0
 */
public class OpenApisContactV3DepartmentsDepartmentIdInput extends AbstractAPIInput {

    private String departmentId;

    public String getDepartmentId() {
        return departmentId;
    }

    public void setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
    }


    public final String toBody(OpenApisContactV3DepartmentsDepartmentIdInput input) {
        return null;
    }

    /**
     * 定义路径
     */
    public final void eventCmd() {
        String format = MessageFormat.format(RequestMappering.open_apis_contact_v3_departments_department_id.getMapperName(),
                this.getDepartmentId());
        if (StringUtils.isNotBlank(this.getUserIdType())) {
            format = format + "?user_id_type=" + this.getUserIdType();
        }
        if (StringUtils.isNotBlank(this.getDepartmentIdType())) {
            format = format + "&department_id_type=" + this.getDepartmentIdType();
        }
        this.setCmdId(format);
    }
}
